//
//  sock_act.h
// 
//
//  Created by  AbbyCin on 10/28/14.
//  Copyright (c) 2014  AbbyCin. All rights reserved.
//

#ifndef remote_execute_sock_act_h
#define remote_execute_sock_act_h

#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <errno.h>
#include <unistd.h>
#include <netdb.h>
#include <stdbool.h> /* bool */

// hostname is ipv4 addr or ipv6 addr or such as www.google.com

// service is a port number or a service name such as '22 / sshd'


/* specifically for SOCK_DGRAM */
int Bind(const char *hostname, const char *service, int type, socklen_t *address_len);

/* bind and listen 2 in 1 function, specifically for SOCK_STREAM  */
int Listen(const char *hostname, const char *service, socklen_t *address_len, int backlog);

int Connect(const char *hostname, const char *service, int type);


#endif
